<%--
  Created by IntelliJ IDEA.
  User: yanchao
  Date: 2021/11/7
  Time: 下午2:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>个人信息 - 助学贷款系统</title>
    <link rel="stylesheet" href="./static/layui/css/layui.css">
    <link rel="stylesheet" href="./static/admin/css/style.css">
    <script src="./static/layui/layui.js"></script>
    <script src="./static/js/jquery-3.3.1.min.js"></script>
    <script src="./static/js/vue.min.js"></script>
    <script src="./static/admin/js/userConfig.js"></script>
</head>
<body class="p20">



<table class="layui-table layui-form">

    <thead>
    <tr>
        <th>用户名</th>
        <th>姓名</th>
        <th>电话</th>
        <th>性别</th>
        <th>年龄</th>
        <th>学校</th>
        <th>专业</th>
        <th>状态</th>
        <th><a>操作</a></th>
    </tr>
    </thead>
    <tbody>
        <tr class="id36567">
            <td>${sessionScope.user.username}</td>
            <td>${sessionScope.user.realname}</td>
            <td>${sessionScope.user.phone}</td>
            <td>${sessionScope.user.sex}</td>
            <td>${sessionScope.user.age}</td>
            <td>${sessionScope.user.school}</td>
            <td>${sessionScope.user.major}</td>
            <c:if test="${sessionScope.user.status == 1}"><td>正常</td></c:if>
            <c:if test="${sessionScope.user.status == 0}"><td>封禁</td></c:if>
            <c:if test="${sessionScope.user.status == 2}"><td>审核中</td></c:if>
            <td>
                <button type="button" class="layui-btn layui-btn-sm" onclick="userEdit()">信息维护</button>
                <button type="button" class="layui-btn layui-btn-sm" onclick="userPwd()">修改密码</button>
                <c:if test="${sessionScope.user.status == 0}"><button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="userApplyStatus(${sessionScope.user.id})">申请解封</button></c:if>
                <c:if test="${sessionScope.user.status == 1}"><button type="button" class="layui-btn layui-btn-sm layui-btn-danger layui-btn-disabled" onclick="">申请解封</button></c:if>
                <c:if test="${sessionScope.user.status == 2}"><button type="button" class="layui-btn layui-btn-sm layui-btn-danger layui-btn-disabled" onclick="">申请解封</button></c:if>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="upload()">上传头像</button>
            </td>
        </tr>
    </tbody>
</table>
<script src="./static/admin/js/script.js"></script>
<script type="text/javascript" language="javascript">
    function upload() {
        window.location.href="upload";
    }
    function userEdit() {
        window.location.href="userEdit";
    }
    function userPwd() {
        window.location.href="userPwd";
    }
    function userApplyStatus(id) {
        var message=confirm("你确定要提交解封账号申请吗？");
        if(message===true)
        {
            window.location.href="userApplyStatus.do?id="+id;
        }
        else if(message==false)
        {
            window.location.href="userInfo.do";
        }
    }
</script>
</body>
</html>
